package cn.jingyuan.owl.model.core;

public class RestResult<D> extends Result<D> {

    /** 响应状态码 */
    protected Integer status;

    /** 详细信息 */
    protected String message;

    public RestResult() { }

    public RestResult(String code, String codeMsg) {
        this(code, codeMsg, null, null, null);
    }

    public RestResult(String code, String codeMsg, D data) {
        this(code, codeMsg, data, null, null);
    }

    public RestResult(String code, String codeMsg, D data, Integer status, String message) {
        super(code, codeMsg, data);
        this.status = status;
        this.message = message;
    }

    @Override
    public RestResult<D> setCode(String code) {
        super.setCode(code);
        return this;
    }

    @Override
    public RestResult<D> setCodeMsg(String codeMsg) {
        super.setCodeMsg(codeMsg);
        return this;
    }

    @Override
    public RestResult<D> setData(D data) {
        super.setData(data);
        return this;
    }

    public RestResult<D> setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public RestResult<D> setMessage(String message) {
        this.message = message;
        return this;
    }

}
